from django.db import models
from mongoengine import *

# Create your models here.


class MenuFood(EmbeddedDocument):
    id = IntField()     # id
    name = StringField()    # 菜谱名
    price = FloatField()    # 价格
    remarks = StringField()     # 备注
    image = StringField()       # 图片路径
    status = StringField()      # 状态


class CookBook(Document):
    period_number = StringField()       # 菜谱期数
    status = StringField()      # 状态
    banner = StringField()      # 顶部图片路径
    community_id = ObjectIdField()      # 社区id
    community_name = StringField()      # 社区名称
    order_time = StringField()          # 订餐时间
    delivery_time = StringField()       # 配送时间
    hot_push = StringField()            # 热推
    menu = ListField(EmbeddedDocumentField(MenuFood))       # 菜谱列表

    meta = {'collection': 'cookbook'}   # 指明连接数据库的哪张表







